#include<stdio.h>
#include<stdlib.h>
#include<filesystem>
using namespace std;
typedef struct student{
    int id;
    int grade;
}*st;
int search(char *filename,int id){
    FILE *fr=fopen(filename,"r");
    if(fr==NULL){
        printf("error!");
        exit(1);
    }
    while(!feof(fr)){
        st node=(st)malloc(sizeof(struct student));
        fscanf(fr,"%d",&node->id);
        if(node->id==id)
            return 1;
    }
    fclose(fr);
    return -1;
}
int main(){
    char filename[1024]="./source.txt";
    printf("%d",search(filename,3));
    return 0;
}